var app = getApp();
var request = app.request;
var setting = app.globalData.setting;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    url: setting.url,
    goodsList: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  getChangePackge: function (e) {
    var that = this;
    var mixture_ticket_code = e.detail.value;
    console.log(mixture_ticket_code);
    request.post('/api/PickTicket/ajaxChangePackge?mixture_ticket_code=' + mixture_ticket_code, {
      isShowLoading: false,
      success: function (res) {
        that.setData({ goodsList: res.data.result.goods_list})
      }
    });  
  },
  checkData: function (e) {
    console.log(e.detail.value);
    var mixture_ticket_code = e.detail.value.mixture_ticket_code;
    var password = e.detail.value.password;
    var that = this;
    var tmp_url = "/api/PickTicket/checkData?mixture_ticket_code=" + mixture_ticket_code + "&password=" + password;
    request.post(tmp_url, {
      isShowLoading: false,
      success: function (res) {
        wx.navigateTo({ url: '/pages/activity/take_change/take_change?mixture_ticket_code=' + mixture_ticket_code});
      }
    }); 
  }
})